<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
        <meta charset="utf-8">
        <title><?php echo ($seo_title); ?></title>
        <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
        <script src="/Static/mobile/js/jquery.js"></script>
        <script src="/Static/mobile/js/layer.mobile-v1.6/layer.m.js"></script>
        <script src="/Static/mobile/js/common.js?i=1"></script>
        <link rel="stylesheet" type="text/css" href="/Static/mobile/iconfont/iconfont.css">
        <link rel="stylesheet" href="//at.alicdn.com/t/font_813618_4lm1s8y9h0t.css">
        <script>
        var _hmt = _hmt || [];
        (function() {
                var hm = document.createElement("script");
                hm.src = "https://hm.baidu.com/hm.js?a524f349a84f50ed8afa8dcd907a59e9";
                var s = document.getElementsByTagName("script")[0]; 
                s.parentNode.insertBefore(hm, s);
        })();
        </script>
        <!-- 微信分享 -->
        
	</head>
<body>
<link rel="stylesheet" href="/Static/mobile/index/css/swiper.min.css">
<link rel="stylesheet" href="/Static/mobile/index/css/index.css">
<div id='app' style="display: none;">
    <div class='fixed-div'>
        <!--头部搜索-->
        <div class='header-search-div'>
            <div class='form-search-div'>
                <form action="/" @submit.prevent="checkForm" class='form-search'>
                    <i class='iconfont icon-sousuo search-icon'/></i>
                    <input type="text" class='search-inp'
                        v-model='keyword' :placeholder='placeholder'>
                </form>
            </div>
            <div class='cart-icon-div'>
                <i @click="location.href='/mobile/cart/mycart'" class='iconfont icon-gouwuche cart-icon'></i>
            </div>
        </div>

        <div class='header-sort-div'>
            <van-tabs @click='changeSort'>
                <van-tab v-for="(item,index,key) in sort1"
                    :key='key'
                    :data-index='index'
                    :title="item.text"
                >
                    
                </van-tab>
            </van-tabs>
        </div>
    </div>


    <!--首页分类1-->
    <div class='header-sort-div sort-content'>
        <!--分类的内容-->
        <div class='header-sort-content'>
            <!--首页的内容-->
            <div class='content home-content' :class='{active:chooseIndex==0&&!isSearch}'>
                <!--轮播图-->
                <van-swipe class='swiper' :autoplay="3000">
                    <van-swipe-item v-for="(imageItem, index) in home.banner_imgs" :key="index">
                        <img  @click="location.href=imageItem.url" v-lazy="imageItem.img" :src='imageItem.img' />
                    </van-swipe-item>
                </van-swipe>

                <!-- 图标 -->
                <van-row style="margin-top:10px;" type="flex" justify="center" align="center">
                    <?php if(get_device_type()=='android'||$is_wechat) { ?>
                        
                    <?php } ?>
                    <van-col style="text-align: center" span="6">
                        <a href="/mobile/index/makemoney">
                            <img width="65" src="http://aidu201710.b0.upaiyun.com/upload/goods/2018-11/01/328391541055790.png">
                        </a>
                    </van-col>
                    <van-col style="text-align: center" span="6">
                        <a href="/mobile/goods/daili">
                            <img width="65" src="http://aidu201710.b0.upaiyun.com/upload/goods/2018-11/01/888651541055789.png">
                        </a>
                    </van-col>
                    <van-col style="text-align: center" span="6">
                        <a onclick="showMeiqia()" id="meiqiakefu">
                            <img width="65" src="http://aidu201710.b0.upaiyun.com/upload/goods/2018-11/01/683661541055789.png">
                        </a>
                    </van-col>
                    <van-col style="text-align: center" span="6">
                        <a href="/mobile/qrcode">
                            <img width="65" src="http://aidu201710.b0.upaiyun.com/upload/goods/2018-12/11/594271544503950.png">
                        </a>
                    </van-col>
                </van-row>
               
                <!--列表内容-->
                <div class='items-list'>
                    <!--本月新品-->
                    <div class='item news-item'>
                        <p class='title'>
                            <img src="/Static/mobile/index/images/xinpin.png" alt="">
                            <span class='text'>本月新品</span>
                        </p>
                        <!--可左右移动的-->
                        <div class="swiper-div swiper-container">
                            <div class="swiper-wrapper swiper">
                                <div class="swiper-slide"
                                    v-for="(imageItem, index) in home.swiper_view" :key="index"
                                >  
                                <img class='prevImg' @click="location.href=imageItem.url" v-lazy="imageItem.img" :src='imageItem.img'/>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--热卖单品-->
                    <div class='item'>
                        <p class='title'>
                            <img src="/Static/mobile/index/images/jiebantubiao-.png" alt="">
                            <span class='text'>热卖单品</span>
                        </p>
                        <div class='hot-lists-div'>
                            <ul>
                                <li v-for='(item,index,key) in home.hot_goods' :key='key'>
                                    <img @click="location.href=item.url" :src="item.img" alt="">
                                    <p class='goods_name'>{{item.name}}</p>
                                    <p class='price'>
                                        <span class='money'>￥{{item.price}}</span>
                                        <span class='line_through'>￥{{item.market_pri}}</span>
                                    </p>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <!--学习中心-->
                    <div class='item'>
                        <p class='title'>
                            <img src="/Static/mobile/index/images/sanjiaoxing.png" alt="">
                            <span class='text'>学习中心</span>
                        </p>
                        <div  class='study-div'>
                            <img @click="location.href='/mobile/article/lists'" src="<?=C('UPYUN_DOMAIN').C('ARTICLE_INDEX_IMG')?>" alt="">
                        </div>

                    </div>
                </div>
            </div>

            <!--美妆护肤的内容-->
            <template v-for="(typeItem,typeIndex) in sort1">
                <div class='content meizhuang-content' :class='{active:chooseIndex==typeIndex&&!isSearch}'>
                    <ul class='content-ul'>
                        <li @click="location.href=item.url" v-for='(item,index,key) in typeItem.list' :key='key'>
                            <img :src="item.img" alt="">
                            <p class='goods_name'>{{item.goods_name}}</p>
                            <p class='goods_desc'>
                                <span class='desc1'>{{item.desc1}}</span>
                                <span class='desc2'>{{item.desc2}}</span>
                            </p>
                            <p class='buyed'>{{item.buy_num}}人已买</p>
                            <p class='goods_price'>
                                <span class='price'>￥{{item.price}}</span>
                                <span class='origin_price'>原价：<span>￥{{item.market_pri}}</span></span>
                                <span class='buy_btn'>立即购买</span>
                            </p>
                        </li>
                    </ul>
                </div>
            </template>
          
            <div class='content meizhuang-content' :class='{active:isSearch}'>
                <ul class='content-ul'>
                    <li @click="location.href=item.url" v-for='(item,index,key) in searchResult' :key='key'>
                        <img :src="item.img" alt="">
                        <p class='goods_name'>{{item.goods_name}}</p>
                        <p class='goods_desc'>
                            <span class='desc1'>{{item.desc1}}</span>
                            <span class='desc2'>{{item.desc2}}</span>
                        </p>
                        <p class='buyed'>{{item.buy_num}}人已买</p>
                        <p class='goods_price'>
                            <span class='price'>￥{{item.price}}</span>
                            <span class='origin_price'>原价：<span>￥{{item.market_pri}}</span></span>
                            <span class='buy_btn'>立即购买</span>
                        </p>
                    </li>
                </ul>
            </div>

        </div>
    </div>
    <!--底部导航-->
</div>

<link rel="stylesheet" href="//at.alicdn.com/t/font_813618_4lm1s8y9h0t.css">
<link rel="stylesheet" href="/Static/mobile/vant/index.css">
<script src="/Static/mobile/vant/vue.min.js"></script>
<script src="/Static/mobile/vant/vant.min.js?i=1"></script>
<div id="nav">
	<van-tabbar style="z-index: 1000;">
		<van-tabbar-item url="/mobile/index">
			<span>首页</span>
            <i slot="icon" style="font-size: 20px;<?php echo $controller=='index'?'color:#e6207a;':'';?>" class="icon iconfont icon-home<?php echo $controller=='index'?'fill':'';?>"></i>
        </van-tabbar-item>
        <?php if($is_wechat) { ?>
            <van-tabbar-item url="/mobile/cart/mycart">
                <span>购物车</span>
                <i slot="icon" style="font-size: 20px;<?php echo $controller=='cart'&&$action=='mycart'?'color:#e6207a;':'';?>" class="icon iconfont <?php echo $controller=='cart'&&$action=='mycart'?'icon-gouwuche':'icon-cart_light';?>"></i>
            </van-tabbar-item>
        <van-tabbar-item url="/mobile/qrcode">
            <span>推广</span>
            <i slot="icon" style="font-size: 20px;<?php echo $controller=='qrcode'?'color:#e6207a;':'';?>" class="icon iconfont icon-qrcode<?php echo $action=='lists'?'':'';?>"></i>
        </van-tabbar-item>
        <?php } ?>
       <!--  <?php if(!$is_wechat&&get_device_type()=='ios') { ?>
            <van-tabbar-item url="/mobile/cart/mycart">
                <span>购物车</span>
                <i slot="icon" style="font-size: 20px;<?php echo $controller=='cart'&&$action=='mycart'?'color:#e6207a;':'';?>" class="icon iconfont <?php echo $controller=='cart'&&$action=='mycart'?'icon-gouwuche':'icon-cart_light';?>"></i>
            </van-tabbar-item>
            <van-tabbar-item url="/mobile/login/faxian">
                <span>发现</span>
                <i slot="icon" style="font-size: 25px;<?php echo $controller=='login'?'color:#e6207a;':'';?>" class="icon iconfont icon-faxian<?php echo $controller=='login'?'':'1';?>"></i>
            </van-tabbar-item>
        <?php } ?> -->
        <?php if(!$is_wechat) { ?>
            <van-tabbar-item url="/mobile/login/faxian">
                <span>发现</span>
                <i slot="icon" style="font-size: 25px;<?php echo $controller=='login'?'color:#e6207a;':'';?>" class="icon iconfont icon-faxian<?php echo $controller=='login'?'':'1';?>"></i>
            </van-tabbar-item>
            <van-tabbar-item url="/mobile/qrcode">
                <span>推广</span>
                <i slot="icon" style="font-size: 20px;<?php echo $controller=='qrcode'?'color:#e6207a;':'';?>" class="icon iconfont icon-qrcode<?php echo $action=='lists'?'':'';?>"></i>
            </van-tabbar-item>
        <?php } ?>
        
        <van-tabbar-item url="/mobile/user/">
            <span>我的</span>
            <i slot="icon" style="font-size: 20px;<?php echo $controller=='user'?'color:#e6207a;':'';?>" class="icon iconfont icon-people<?php echo $controller=='user'?'fill':'';?>"></i>
        </van-tabbar-item>
	</van-tabbar>
</div>
<script>
    var nav = new Vue({
        el: '#nav',
        data: {
            os:''
        },
        watch: {
        },
        mounted: function () {
        },
        methods: {
        }
    })
</script>
<style>
</style>
<style>
.van-tabs__line {
    background-color: #E40075 !important;
}
.van-tabs__wrap--scrollable .van-tab {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 25%;
    flex: 0 0 25%;
}
.header-sort-div .items-list .news-item {
    margin-top: 0;
}
</style>
<script src='/Static/mobile/index/js/swiper.min.js'></script>
<script src='/Static/mobile/index/js/index.js?i=3'></script>
<script>
//初始化swiper
window.onload = function(){
    var mySwiper = new Swiper('.swiper-container',{
        effect : 'coverflow',
        slidesPerView: "auto",
        centeredSlides: true,
        coverflowEffect: {
            rotate: 0,
            stretch: 20,
            depth: 60,
            modifier: 2,
            slideShadows : true
        },
        loop: true, // 循环模式选项
        observer:true, //修改swiper自己或子元素时，自动初始化swiper
        //observeParents:true//修改swiper的父元素时，自动初始化swiper
    });
}
</script>
<!-- 如果是微信客户端 -->
<input id="networkType" value="" type="hidden">
<?php if($is_wechat){ ?>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
<script type="text/javascript">
		wx.config({
		
		<?php if($hlopenid =="oaGjOtyJCTObWB2BZbkLfxyVHTMA"){?>
		 debug:true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，
		
		<?php } ?>
		
		  //若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
		  appId:'<?php echo ($jssign['appid']); ?>', // 必填，公众号的唯一标识
		  timestamp:'<?php echo ($jssign['timestamp']); ?>', // 必填，生成签名的时间戳
		  nonceStr:'<?php echo ($jssign['noncestr']); ?>', // 必填，生成签名的随机串
		  signature:'<?php echo ($jssign['signature']); ?>',// 必填，签名，见附录1
	      jsApiList: [
	                  'checkJsApi',
	                  'onMenuShareTimeline',
	                  'onMenuShareAppMessage',
	                  'onMenuShareQQ',
	                  'onMenuShareWeibo',
	                  'onMenuShareQZone',
	                  'hideMenuItems',
	                  'showMenuItems',
	                  'hideAllNonBaseMenuItem',
	                  'showAllNonBaseMenuItem',
	                  'translateVoice',
	                  'startRecord',
	                  'stopRecord',
	                  'onVoiceRecordEnd',
	                  'playVoice',
	                  'onVoicePlayEnd',
	                  'pauseVoice',
	                  'stopVoice',
	                  'uploadVoice',
	                  'downloadVoice',
	                  'chooseImage',
	                  'previewImage',
	                  'uploadImage',
	                  'downloadImage',
	                  'getNetworkType',
	                  'openLocation',
	                  'getLocation',
	                  'hideOptionMenu',
	                  'showOptionMenu',
	                  'closeWindow',
	                  'scanQRCode',
	                  'chooseWXPay',
	                  'openProductSpecificView',
	                  'addCard',
	                  'chooseCard',
	                  'openCard'
	                ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
		});
		
		wx.ready(function(){
			//分享到朋友圈
		  wx.onMenuShareTimeline({
		    title:'<?php echo $share_title ? $share_title : C("SHARE_DEFAULT_TITLE");?>', // 分享标题
		    link:'<?php echo $share_url ? $share_url : C("SHARE_DEFAULT_URL");?>', // 分享链接
		    imgUrl:'<?php echo $share_img ? $share_img : C("SHARE_DEFAULT_IMG");?>', // 分享图标
		    success: function(){
		    	
		    },
		    cancel: function(){
		    }
		  });
		  //分享给好友
		  wx.onMenuShareAppMessage({
		    title:'<?php echo $share_title ? $share_title : C("SHARE_DEFAULT_TITLE");?>', // 分享标题
		    desc:'<?php echo $share_description ? $share_description : C("SHARE_DEFAULT_DESC");?>', // 分享描述
		    link:'<?php echo $share_url ? $share_url : C("SHARE_DEFAULT_URL");?>', // 分享链接
		    imgUrl:'<?php echo $share_img ? $share_img : C("SHARE_DEFAULT_IMG");?>', // 分享图标
		    type: '',
		    dataUrl: '',
		    success: function () { 
		    },
		    cancel: function () { 
		
		    }
		  });  
		  
		  wx.getNetworkType({
			    success: function (res) {
			        var networkType = res.networkType; // 返回网络类型2g，3g，4g，wifi
			        $("#networkType").val(networkType);
			    }
			});
		  
		  //复制链接menuItem:copyUrl
		  wx.hideMenuItems({
			 menuList: ["menuItem:originPage",
			            "menuItem:share:facebook",
			            "menuItem:share:qq",
			            "menuItem:share:weiboApp",
			            "menuItem:share:QZone",
			            "menuItem:readMode",
			         //   "menuItem:openWithQQBrowser",
			         //   "menuItem:openWithSafari",
			            "menuItem:share:email",
			            "menuItem:share:brand",
			            "menuItem:copyUrl",//复制链接
			            "menuItem:share:timeline",//朋友圈
			            "menuItem:share:appMessage",//朋友
			            ], // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
		      success: function (res) {
		         // alert('已隐藏“阅读模式”，“分享到朋友圈”，“复制链接”等按钮');
		        },
		        fail: function (res) {
		          //alert(JSON.stringify(res));
		        }
		  });
		  
		  //wx.hideOptionMenu();//批量隐藏保护类 传播类按钮
		 
		});

		//浏览图片
		function previewImage(now_pic,pics){
			wx.previewImage({
			   current: now_pic, // 当前显示图片的http链接
			   urls: pics // 需要预览的图片http链接列表
			});
		}
		
		//浏览图片
		$('.previewImageList').on('click', function(){
			var now_pic = $(this).attr("src");
			var pics = new Array();
			
			$('.previewImage').each(function(index) {
				pics[index] = $(this).attr("src");
			 });
			
			previewImage(now_pic,pics);
			
		});

		</script>

<?php } ?>
<script>

var plusobj = {
    createDownload: function (url,callbackFunction) {
        let dtask = plus.downloader.createDownload(url);
        dtask.addEventListener( "statechanged", callbackFunction, false );
        dtask.start(); 
    },
    delFile: function (relativePath) {
        plus.io.resolveLocalFileSystemURL(relativePath, function(entry) {
            entry.remove(function(entry) {
                console.log("文件删除成功==" + relativePath);
            }, function(e) {
                console.log("文件删除失败=" + relativePath);
            });
        });
    },
    shareWeixinPic: function  (files,scene) {
        var self = this;
        plus.share.getServices( function(s){
            var shares = s;
            shares.forEach((item)=>{
              if(item.id='weixin') {
                item.send( {pictures:files,extra:{scene:scene?scene:"WXSceneSession"}}, function(){
                  
                }, function(e){
                  self.delFile(file)
                });
              }
            })
          }, function(e){
            alert( "获取分享服务列表失败："+e.message );
          } );
    },
	shareMsg: function  (msg) {
        var self = this;
        plus.share.getServices( function(s){
            var shares = s;
            shares.forEach((item)=>{
              if(item.id='weixin') {
                item.send(msg, function(){
                }, function(e){
                });
              }
            })
          }, function(e){
          } );
    }
}

function myshare () {
	plus.nativeUI.actionSheet({
		title: '分享到',
		cancel: "取消",
		buttons: [{
			title: "微信消息"
		}, {
			title: "微信朋友圈"
		}]
	}, function(e) {
		var index = e.index;
		if(index<0) {
			return false;
		}
		switch(index) {
			case 1: //分享到微信好友
				plusobj.shareMsg({
					title:'<?php echo $share_title ? $share_title : C("SHARE_DEFAULT_TITLE");?>', // 分享标题
					content:'<?php echo $share_description ? $share_description : C("SHARE_DEFAULT_DESC");?>', // 分享描述
					href: '<?php echo $share_url ? $share_url : C("SHARE_DEFAULT_URL");?>',//分享出去后，点击跳转地址
					thumbs: ['<?php echo $share_img ? $share_img : C("SHARE_DEFAULT_IMG");?>'], //分享缩略图
					extra:{scene:"WXSceneSession"}
				});
				break;
			case 2: //分享到微信朋友圈
				plusobj.shareMsg({
					title:'<?php echo $share_title ? $share_title : C("SHARE_DEFAULT_TITLE");?>', // 分享标题
					content:'<?php echo $share_description ? $share_description : C("SHARE_DEFAULT_DESC");?>', // 分享描述
					href: '<?php echo $share_url ? $share_url : C("SHARE_DEFAULT_URL");?>',//分享出去后，点击跳转地址
					thumbs: ['<?php echo $share_img ? $share_img : C("SHARE_DEFAULT_IMG");?>'], //分享缩略图
					extra:{scene:"WXSceneTimeline"}
				});
				break;
		}
	})
}

document.addEventListener("plusready",function(){
	var token = plus.storage.getItem('token');
	if(token) {
		
		$.get('/mobile/login/tokenLogin?token='+token).then(function(res){
			if(res.ret==1) {
				//清除storage
				plus.storage.removeItem('token');
			}else{
				//alert('登录成功');
			}
		})
	}
	//plus.webview.currentWebview().setStyle({titleNView: {buttons: []}});
	if(plus.os.name=='Android') {
		/* if(plus.runtime.version=='1.0') {
			var url="http://ui.vip36.cn/android2.apk"; 
			var dtask = plus.downloader.createDownload( url, {}, function ( d, status ) {
				if ( status == 200 ) { 
					var path = d.filename;
					plus.runtime.install(path);
				} else {
					alert( "Download failed: " + status ); 
				}  
			});
			dtask.start(); 
		} */
	}
},false);

</script>
<script type='text/javascript'>
    (function(m, ei, q, i, a, j, s) {
        m[i] = m[i] || function() {
            (m[i].a = m[i].a || []).push(arguments)
        };
        j = ei.createElement(q),
            s = ei.getElementsByTagName(q)[0];
        j.async = true;
        j.charset = 'UTF-8';
        j.src = 'https://static.meiqia.com/dist/meiqia.js?_=t';
        s.parentNode.insertBefore(j, s);
    })(window, document, 'script', '_MEIQIA');
    _MEIQIA('entId', 132278);
</script>
<script>
        var winHeight = $(window).height();  //获取当前页面高度
        $(window).resize(function () {
            var thisHeight = $(this).height();
            if ( winHeight - thisHeight > 140 ) {
                //键盘弹出
                $('.bottom-fixed').hide();
            } else {
                //键盘收起
                $('.bottom-fixed').show();
            }
        })
</script>
<script>
       /*  $('body').on('click','#meiqiakefu',function(){
            $('#MEIQIA-BTN-ICON').click();
        }); */
        function showMeiqia() {
            $('#MEIQIA-BTN-ICON').click();
            location.href= location.href+'#sdsd';
        }
</script>

<?php if($memberinfo['uid']!=1481) { ?>
    <style>
        #MEIQIA-BTN {
            display:none;
        }
    </style>
<?php } ?>

</body>
</html>